#include("/common/layout/bootstrap_form_layout.html")
#@layout()
#define head()
#define title()
#(jxrb.message("jxEmailSendParam"))
#end
<script>
  seajs.use(["jquery", "jx_msgbox_plus"], function ($, msgbox) {

    $("#b_submit").on("click", function () {
      if (!checkMail())
        return;
      msgbox.alert({url: "#(controllerKey)jxEmailParams/"},
      function ()
      {
        msgbox.close();
      });
    })
    function checkMail()
    {
      var smtpService = $("#smtpService").val();
      var smtpPort = $("#smtpPort").val();
      var smtpUser = $("#smtpUser").val();
      var smtpPass = $("#smtpPass").val();
      var signature = $("#signature").val();
      var subject = $("#subject").val();
      var content = $("#content").val();
      var testMail = $("#testMail").val();
      if (smtpService == null || smtpService == "") {
        alert('#(jxrb.message("jxEmailParam.smtpService","public.isNotNull"))');
        return false;
      }
      if (smtpPort == null || smtpPort == "") {
        alert('#(jxrb.message("jxEmailParam.smtpPort","public.isNotNull"))');
        return false;
      }
      if (smtpUser == null || smtpUser == "") {
        alert('#(jxrb.message("jxEmailParam.smtpUser","public.isNotNull"))');
        return false;
      }
      if (smtpPass == null || smtpPass == "") {
        alert('#(jxrb.message("jxEmailParam.smtpPass","public.isNotNull"))');
        return false;
      }
      if (signature == null || signature == "") {
        alert('#(jxrb.message("jxEmailParam.signature","public.isNotNull"))');
        return false;
      }
      if (subject == null || subject == "") {
        alert('#(jxrb.message("jxEmailParam.subject","public.isNotNull"))');
        return false;
      }
      if (content == null || content == "") {
        alert('#(jxrb.message("jxEmailParam.content","public.isNotNull"))');
        return false;
      }
      if (testMail == null || testMail == "") {
        alert('#(jxrb.message("jxEmailParam.testMail","public.isNotNull"))');
        return false;
      }
      return true;
    }

  });
</script>
#end

#define bodyExt()
class="gray-bg"
#end

#define form()
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.smtpService"))</label>
  <div class="col-sm-9">
    <input type="text" name="jxEmailParam.smtpService" value="#(jxEmailParam.smtpService ??)" id="smtpService" class="form-control"/>
  </div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.smtpPort"))</label>
  <div class="col-sm-9">
    <input type="text" name="jxEmailParam.smtpPort" value="#(jxEmailParam.smtpPort ??)" id="smtpPort" class="form-control"/>
  </div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.smtpUser"))</label>
  <div class="col-sm-9">
    <input type="text" name="jxEmailParam.smtpUser" value="#(jxEmailParam.smtpUser ??)" id="smtpUser" class="form-control"/>
  </div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.smtpPass"))</label>
  <div class="col-sm-9">
    <input type="password" name="jxEmailParam.smtpPass" value="#(jxEmailParam.smtpPass ??)" id="smtpPass" class="form-control"/>
  </div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.signature"))</label>
  <div class="col-sm-9">
    <input type="text" name="jxEmailParam.signature" value="#(jxEmailParam.signature ??)" id="signature" class="form-control"/>
  </div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.subject"))</label>
  <div class="col-sm-9">
    <input type="text" name="mailSendData.subject" value="#(mailSendData.subject ??)" id="subject" class="form-control"/>
  </div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.content"))</label>
  <div class="col-sm-9">
    <textarea rows="3" name="mailSendData.content" id="content" class="form-control">#(mailSendData.content ??)</textarea>
  </div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
  <label class="col-sm-2 control-label">#(jxrb.message("jxEmailParam.testMail"))</label>
  <div class="col-sm-9">
    <input type="text" name="mailSendData.testMail" value="#(mailSendData.testMail ??)" id="testMail" class="form-control"/>
  </div>
</div>
#end

#define formAfter()
<center>
  #jx_button({value:"action.save",class:"btn btn-primary"})
</center>
#end
